$(function () {
    var log_datagrid = $("#log_datagrid");
    var log_dialog = $("#log_dialog");

    //菜单列表初始化
    log_datagrid.datagrid({
        fit: true,
        url: "/systemLog/list",
        fitColumns: true,
        pagination: true,
        rownumbers: true,
        striped: true,
        toolbar: "#tb",
        singleSelect: true,
        columns: [[
            {field: "ck", checkbox: true},  //显示多选框样式
            {field: "id", title: "编号", hidden: true},
            {field: "opuser", title: "操作者", width: 100,formatter:function (value) {
                return value ? value.username : "未知神秘人";
            }},
            {field: "optime", title: "操作时间", width: 100},
            {field: "opip", title: "IP地址", width: 100},
            {field: "function", title: "访问的方法", width: 100},
            {field: "params", title: "参数", width: 100}
        ]]
    });
    //end

    //响应函数集合对象
    var cmdObj = {
        //工具栏的刷新
        reload: function () {
            log_datagrid.datagrid("load");
        }
    };
    //end
    //调用
    $("a[data-cmd]").click(function () {
        var cmd = $(this).data("cmd");
        cmdObj[cmd]();
    })
});


